package com.suntianci.stock.mapper;

import com.suntianci.stock.pojo.entity.SysRolePermission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 孙天赐
* @description 针对表【sys_role_permission(角色权限表)】的数据库操作Mapper
* @createDate 2024-12-24 15:39:27
* @Entity com.suntianci.stock.pojo.entity.SysRolePermission
*/
public interface SysRolePermissionMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysRolePermission record);

    int insertSelective(SysRolePermission record);

    SysRolePermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysRolePermission record);

    int updateByPrimaryKey(SysRolePermission record);

    /**
     * 根据角色id删除数据
     * @param roleId
     */
    void deleteByRoleId(Long roleId);

    /**
     * 根据角色id查找对应的权限id集合
     * @param roleId
     * @return
     */
    List<String> getPermissionIdByRoleId(String roleId);

    /**
     * 根据权限id删除数据
     * @param permissionId
     * @return
     */
    int deleteByPermissionId(Long permissionId);

    /**
     * 根据权限id删除相关信息
     * @param permissionIds
     */
    int batchDeleteByPermissionId(@Param("permissionIds") List<Long> permissionIds);
}
